import java.util.HashSet;
import java.util.Scanner;
import java.util.Set;

public class Test {
    static int result;
    public static void main(String[] args) {
        Set<String> set = new HashSet<>();
       Scanner sc = new Scanner(System.in);
       while(sc.hasNextLine()){
           String str = sc.nextLine();
           func(str,set);
       }
        System.out.println(result);
       sc.close();
    }
    public static void func(String str,Set<String> set){
        String[] s = str.split(" ");
        for(String ss : s){
            if(set.add(ss)){
                result++;
            }
        }
    }

}
